﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CCH.DAO;
using CCH.Entity;

public partial class _20_2004_4 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            int alb_no = int.Parse(Request["alb_no"]);
            int pho_no = int.Parse(Request["pho_no"]);

            photo d = new albumDAO().Get_photo(alb_no, pho_no);

            this.tbox_desc.Text = d.pho_desc.ConvertToNewLine();

            this.Image1.ImageUrl = String.Format("2004-3.ashx?alb_no={0}&pho_no={1}", alb_no, pho_no);
        }
    }

    protected void Page_LoadComplete(object sender, EventArgs e)
    {
        this.tbox_desc.Focus();
    }

    protected void btn_ok_Click(object sender, EventArgs e)
    {
        int alb_no = int.Parse(Request["alb_no"]);
        int pho_no = int.Parse(Request["pho_no"]);

        albumDAO dao = new albumDAO();
        photo d = dao.Get_photo(alb_no, pho_no);
        d.pho_desc = this.tbox_desc.Text.ConvertToBR();
        dao.Update();

        JsUtil.UpdateParentJs(this, "照片描述完成!");
        


    }
}